package com.example.shiro.model.sys.service.impl;

import com.example.shiro.model.sys.entity.AuthEntity;
import com.example.shiro.model.sys.mapper.AuthMapper;
import com.example.shiro.model.sys.mapper.RoleAuthMapper;
import com.example.shiro.model.sys.service.AuthService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
 * <p>
 * 权限资源表 服务实现类
 * </p>
 *
 * @author jatej
 * @since 2020-04-16
 */
@Service
public class AuthServiceImpl extends ServiceImpl<AuthMapper, AuthEntity> implements AuthService {

    @Autowired
    private RoleAuthMapper roleAuthMapper;

    /**
     * 通过用户ID查询权限集合
     * @param userId
     * @return
     */
    @Override
    public Set<String> getAuthByUserId(Integer userId) {
        return roleAuthMapper.getAuthNameByUserId( userId );
    }
}
